Skip to content

bi7/0a: io.USB: a serial number is read through the descriptor, not PyUSB's empty cache - #1638

Open
cmoscy wants to merge 1 commit into
PyLabRobot:mainfrom
cmoscy:bi7/0a-usb
Open

cmoscy wants to merge 1 commit into
PyLabRobot:mainfrom
cmoscy:bi7/0a-usb

Conversation

@cmoscy

@cmoscy cmoscy commented Nov 16, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Fix USB device selection by serial number: read dev.serial_number from the descriptor instead of PyUSB's empty _serial_number cache after enumeration.
  • Devices with no serial (iSerialNumber == 0) are still refused.

Test plan

  • Existing io.USB serial-number selection tests pass

… empty cache

Choosing a device by `serial_number` compared it with `dev._serial_number`, which PyUSB fills
only once something has read `dev.serial_number`. Straight after enumeration it is None, so every
device was refused as having no serial number. The serial number is now read through the
descriptor (`dev.serial_number`), and a device without one (`iSerialNumber == 0`) is still refused.
@cmoscy cmoscy changed the title io.USB: a serial number is read through the descriptor, not PyUSB's empty cache bi7/0a: io.USB: a serial number is read through the descriptor, not PyUSB's empty cache Nov 17, 2026
@cmoscy
cmoscy marked this pull request as ready for review November 17, 2026 03:48
@cmoscy
cmoscy requested a review from a team as a code owner November 17, 2026 03:48

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant